extends Node

const CARD_TYPE_NORMAL = 0

var card_datas = {
    'burning': {
        'name': '奋斗Burning',
        'desc': '支付1个健康标记，获取3金币。',
    },
    'relax': {
        'name': '修养身心',
        'desc': '移除1个健康标记',
    },
    'work': {
        'name': '工作',
        'desc': '获取1金币',
    },
    'stock': {
        'name': '炒股票',
        'desc': '随机获得1金币，或者失去2金币',
    },
    'feast': {
        'name': '胡吃海喝',
        'desc': '支付1个健康标记，移除2个抑郁标记',
    },
}

var user_card_node = preload("res://Game/Components/Cards/User/user_card.tscn")


func _ready() -> void:
    pass

func create_card(unique_name) -> Card:
    var card_data = null
    if unique_name in card_datas:
        card_data = card_datas[unique_name]
    else:
        return null

    var new_card: UserCard = user_card_node.instance()
    new_card.set_card_name(card_data['name'])
    new_card.set_card_desc(card_data['desc'])
    return new_card

func copy_card(c: Card) -> Card:
    var new_card: UserCard = user_card_node.instance()
    new_card.set_card_name(c.card_name)
    new_card.set_card_desc(c.card_desc)
    new_card.set_face_up(c.is_face_up())
    return new_card
